"""验证码识别工具类"""
import base64
import ddddocr

def get_captcha_code(base_img):

    #先取base64码
    base_64_code = base_img.split(",")[1]

    #base64先解码
    decode_data = base64.b64decode(base_64_code)

    #用ocr识别
    ocr = ddddocr.DdddOcr()
    text = ocr.classification(decode_data)

    return text